﻿using Ext.Net.MVC;
using Sharp.Portal;
using Sharp.Portal.Mvc.List;
using Sharp.Portal.Other;
using System.Collections.Generic;
using Ext.Net;
using Alignment = Ext.Net.Alignment;
using Column = Ext.Net.MVC.ColumnAttribute;
using NumberColumn = Ext.Net.MVC.NumberColumnAttribute;
namespace Sharp.WebBooter.Areas.Platform.Models
{
    [Title("员工管理")]
    [DataHandler(ModuleOP.Details, "浏览", 0, UrlAction = "Details")]
    [DataHandler(ModuleOP.Create, "新增", 1)]
    [DataHandler(ModuleOP.Edit, "修改", 2)]
    [DataHandler(ModuleOP.Delete, "删除", 3)]
    [DataHandler(ModuleOP.Refresh, "刷新", 4)]
    [DataHandler("AsUser", "设为登录用户", 5)]
    public partial class EmployeeIndexModel : Sharp.Portal.ExtNet.ExtSharpList
    {
        public EmployeeIndexModel()
        {
            this.Feature = ListFeature.MultiSelect | ListFeature.Paging | ListFeature.RowNumber;
            this.IsUseOrgTreeLayout = true;
            this.ToolbarButtonParameters.Add(new ToolButtonInfo()
            {
                Mode = "AsUser",
                Direct = new ToolButtonInfo.DirectClickAction("EmployeeAsUser", "Employee"),
                Parameters = new List<ToolButtonInfo.Parameter>()
                {
                    new ToolButtonInfo.Parameter("employeeId", "this.up('grid').getSelectionModel().getSelection()[0].getData().Id", (int) ParameterMode.Raw)
                }
            });
        }
        [Column(Hidden = true)]
        public int Id { get; set; }
        /// <summary>
        /// 工号
        /// </summary>
        [Column(Width = 100, Text = "工号", Locked = true)]
        public string Code { get; set; }


        /// <summary>
        /// 全名
        /// </summary>
        [Column(Width = 140, Text = "全名", Locked = true), QueryOption(Option = QueryFeature.DefualtQuery)]
        public string FullName { get; set; }
        /// <summary>
        /// 姓名简拼
        /// </summary>
        [Column(Width = 100, Text = "简拼", Hidden = true)]
        public string Jianpin { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        [Column(Width = 100, Text = "性别"), MasterData("Gender")]
        public string GenderCode { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        [NumberColumn(Width = 100, Text = "年龄", Align = Alignment.Right, Format = "0"), QueryOption(Option = QueryFeature.NoneQuery)]
        public int? Age { get; set; }
        /// <summary>
        /// 民族
        /// </summary>
        [Column(Width = 100, Text = "民族"), MasterData("Nation")]
        public string NationCode { get; set; }
        /// <summary>
        /// 身份证
        /// </summary>
        [Column(Width = 200, Text = "身份证")]
        public string IdCard { get; set; }
        /// <summary>
        /// 出生年月
        /// </summary>
        [Column(Width = 100, Text = "出生年月")]
        public string Birthday { get; set; }
        /// <summary>
        /// 手机
        /// </summary>
        [Column(Width = 150, Text = "手机")]
        public string Phone { get; set; }

        /// <summary>
        /// 职称
        /// </summary>
        [Column(Width = 150, Text = "职称"), MasterData("Posttitle")]
        public string PosttitleCode { get; set; }

        /// <summary>
        /// 职务
        /// </summary>
        [Column(Width = 150, Text = "职务")]
        public string JobTitle { get; set; }
        /// <summary>
        /// 传真
        /// </summary>
        [Column(Width = 100, Text = "传真")]
        public string Fax { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        [Column(Width = 200, Text = "电子邮件")]
        public string Email { get; set; }
        /// <summary>
        /// 家庭地址
        /// </summary>
        [Column(Width = 260, Text = "家庭地址")]
        public string Address { get; set; }

        /// <summary>
        /// 户籍
        /// </summary>
        [Column(Width = 100, Text = "户籍")]
        public string RegisteredResidence { get; set; }
        /// <summary>
        /// 参加工作
        /// </summary>
        [Column(Width = 100, Text = "参加工作")]
        public string WorkDate { get; set; }
        /// <summary>
        /// 婚姻状况
        /// </summary>
        [Column(Width = 100, Text = "婚姻状况"), MasterData("Married")]
        public string MarriedCode { get; set; }
        /// <summary>
        /// 学历
        /// </summary>
        [Column(Width = 100, Text = "学历"), MasterData("EducationalBackground")]
        public string EducationalBackgroundCode { get; set; }
        /// <summary>
        /// 学位
        /// </summary>
        [Column(Width = 100, Text = "学位"), MasterData("Degree")]
        public string DegreeCode { get; set; }
        /// <summary>
        /// 紧急联系人
        /// </summary>
        [Column(Width = 120, Text = "紧急联系人")]
        public string UrgentContact { get; set; }
        /// <summary>
        /// 紧急联系电话
        /// </summary>
        [Column(Width = 150, Text = "紧急联系电话")]
        public string UrgentPhone { get; set; }
        /// <summary>
        /// 任职状况
        /// </summary>
        [Column(Text = "任职状况"), MasterData("PostState")]
        public string PostStateCode { get; set; }

      
    }
}
